/**
 * 用户管理APi
 */
import request from '/@/utils/request';

export function readAllUser(params: any) {
  return request({
    url: 'mgr/users',
    method: 'get',
    params,
  });
}

export function createUser(data: any) {
  return request({
    url: 'mgr/users',
    method: 'post',
    data,
  });
}

export function updateUser(id: string, data: any) {
  return request({
    url: `users/${id}`,
    method: 'patch',
    data,
  });
}

export function resetPassword(id: string) {
  return request({
    url: `mgr/users/${id}/reset-password`,
    method: 'post',
  });
}

export function deleteUser(id: string) {
  return request({
    url: `mgr/users/${id}`,
    method: 'delete',
  });
}
